package org.fuys.coder.infrastructure.model.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName audit_review
 */
@TableName(value ="audit_review")
@Data
public class AuditReview implements Serializable {
    /**
     * 主键id
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 被审核的作品 或是文件 或是 用户id
     */
    private Long beAuditedId;

    /**
     * 人工审核员id
     */
    private Integer reviewerId;

    /**
     * 都人工审核了 只能是通过或者是不通过
     */
    private Integer reviewResult;

    /**
     * 人工审核原因
     */
    private String reviewReason;

    /**
     * 人工审核的时间
     */
    private Date reviewTime;

    /**
     * 需要通知的用户id
     */
    private Integer userId;

    /**
     * 审核的种类Id
     */
    private Integer typeId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        AuditReview other = (AuditReview) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getBeAuditedId() == null ? other.getBeAuditedId() == null : this.getBeAuditedId().equals(other.getBeAuditedId()))
            && (this.getReviewerId() == null ? other.getReviewerId() == null : this.getReviewerId().equals(other.getReviewerId()))
            && (this.getReviewResult() == null ? other.getReviewResult() == null : this.getReviewResult().equals(other.getReviewResult()))
            && (this.getReviewReason() == null ? other.getReviewReason() == null : this.getReviewReason().equals(other.getReviewReason()))
            && (this.getReviewTime() == null ? other.getReviewTime() == null : this.getReviewTime().equals(other.getReviewTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getBeAuditedId() == null) ? 0 : getBeAuditedId().hashCode());
        result = prime * result + ((getReviewerId() == null) ? 0 : getReviewerId().hashCode());
        result = prime * result + ((getReviewResult() == null) ? 0 : getReviewResult().hashCode());
        result = prime * result + ((getReviewReason() == null) ? 0 : getReviewReason().hashCode());
        result = prime * result + ((getReviewTime() == null) ? 0 : getReviewTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", beAuditedId=").append(beAuditedId);
        sb.append(", reviewerId=").append(reviewerId);
        sb.append(", reviewResult=").append(reviewResult);
        sb.append(", reviewReason=").append(reviewReason);
        sb.append(", reviewTime=").append(reviewTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}